package com.uchiha.nova.core.feign;

import com.uchiha.nova.core.tool.constant.ApplicationConstant;
import com.uchiha.nova.core.tool.constant.NovaCRUDMethodConstant;
import com.uchiha.nova.core.model.dto.CompanyBusinessLicenseDTO;
import com.uchiha.nova.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(value = ApplicationConstant.WEB_SERVICE, configuration = FeignConfiguration.class)
public interface CompanyBusinessLicenseFeignService {

    String BASE = "/companyBusinessLicense";

    /**
     * 详情
     */
    @PostMapping(BASE + NovaCRUDMethodConstant.NOVA_WEB_GETONE)
    R detail(@RequestBody CompanyBusinessLicenseDTO companyBusinessLicenseDTO);

    /**
     * 列表搜索
     */
    @GetMapping(BASE + NovaCRUDMethodConstant.NOVA_WEB_PAGE)
    R getPage(@RequestParam Map<String, Object> map);

    /**
     * 新增
     */
    @PostMapping(BASE + NovaCRUDMethodConstant.NOVA_WEB_SAVE)
    R save(@RequestBody CompanyBusinessLicenseDTO companyBusinessLicenseDTO);

    /**
     * 修改
     */
    @PostMapping(BASE + NovaCRUDMethodConstant.NOVA_WEB_UPDATE)
    R update(@RequestBody CompanyBusinessLicenseDTO companyBusinessLicenseDTO);

    /**
     * 新增或者修改
     */
    @PostMapping(BASE + NovaCRUDMethodConstant.NOVA_WEB_SAVEORUPDATE)
    R saveOrUpdate(@RequestBody CompanyBusinessLicenseDTO companyBusinessLicenseDTO);

    /**
     * 逻辑删除
     */
    @PostMapping(BASE + NovaCRUDMethodConstant.NOVA_WEB_REMOVE)
    R remove(@RequestParam String ids);

    /**
     * 物理删除
     */
    @DeleteMapping(BASE + NovaCRUDMethodConstant.NOVA_WEB_DELETE)
    R delete(@RequestParam String ids);

    @GetMapping(BASE + "/getByName")
    R getByName(@RequestParam("name") String name);
}